package Logic;

public class Authorizer
{
	public static boolean checkRole(String roleList, String currentRole)
	{
		System.out.println("roleList: " + roleList);
		System.out.println("currentRole: " + currentRole);
		if(roleList.equals("0"))
		{
			return false;
		}
		
		String delim = ",";

		String[] roles = roleList.split(delim);

		for (int i = 0; i < roles.length; i++)
		{
			if (roles[i].equals(currentRole))
			{
				System.out.println("Role is verified!");
				return true;
			}
		}
		
		return false;
	}
}
